Browser-based fetch of external libraries

ABSTRACT

A browser-based fetch of an external library may include a browser receiving a request from a web application to load an external library and determining whether the web browser has a bundled version of the library. If the bundled version exists, the browser may load the bundled version. If the bundled version does not exist, the browser may fetch the external library. When the external library is configured to send data to the remote server the method may include the browser intercepting a request to send the data to the remote server, determining that the data may be sent at a later time, and storing the data until a connection with the remote server is established. Additionally, a web store may inspect a web application for use of an external library and prevent the web application from being added to the web store when the external library is not trusted.

TECHNICAL FIELD

This disclosure generally relates to browser control over fetching andexecuting external libraries used by a web application.

BACKGROUND

Browser-based applications, or web applications, are softwareapplications designed to run in a web browser. Such applications areoften available through a web store or digital marketplace and run in aspecific browser. Sometimes third parties offer tools or utilities,often referred to as libraries, for web application developers to use inthe web applications they create. For example, vendors or otherthird-party software developers may offer a library of web analyticstools or a library of video streaming tools for use in other webapplications. Such third party, or external, libraries often providefunctionality the developers could not duplicate on their own withoutgreat cost. These external libraries sometimes receive data collected atthe browser used to provide some features. Additionally, the externallibraries have traditionally been run from the remote server. Thus, anetwork connection is often required to successfully run the webapplication so that the client computer running the browser maycommunicate with the server hosting the library.

While these external libraries expand the functionality of webapplications, use of such libraries has caused security issues. Becauseof this and other issues, some browsers may not allow a web applicationto execute external libraries themselves. Furthermore, such librariesare not available to a web application when running offline because theweb application cannot reach the server that hosts the library. Thus, itwould be desirable to guard against web applications that use maliciousor untested libraries while still allowing applications to use approvedlibraries, whether online or offline.

SUMMARY

One aspect of the disclosure can be embodied in a computer-implementedmethod that includes inspecting a web application for requests to useexternal libraries and determining whether an identified externallibrary is trusted. The method may include preventing the webapplication from being added to a web store when the identified externallibrary is not trusted and allowing the web application to be added tothe web store when the identified external library is trusted. In someimplementations, determining whether the identified external library istrusted may include determining whether the identified external libraryis on a whitelist or a blacklist. In some implementations inspecting theweb application for requests includes inspecting a manifest fileassociated with the web application and determining whether the manifestfile includes an explicit declaration identifying the external library.

Another aspect of the disclosure can be embodied in a method executed byat least one processor performing operations for a web browser, themethod being performed by the web browser. The method may includereceiving a request from a web application to load an external librarystored on a remote server, determining whether the web browser has abundled version of the external library, and loading the bundled versionwhen it is determined that the bundled version exists. In someimplementations, the determining and loading may occur only when alocally cached version of the library does not exist. In suchimplementations the method may further include fetching the externallibrary from the remote server when it is determined that the webbrowser does not have a bundled version of the external library andcaching the external library in a memory associated with the webbrowser.

These and other aspects can include one or more of the followingfeatures. For example, the external library may be bundled with anupdate to the web browser and/or with the web application. The methodmay also include receiving an update to the external library at the webbrowser from the remote server and updating the bundled version when abundled version exists. In some implementations the external library maybe configured to send data to the remote server and the method furtherincludes intercepting a request to send the data to the remote server,determining whether a connection with the server exists. When aconnection does not exist, the method may include determining whetherthe data may be sent at a later time and storing the data until aconnection with the remote server is established when the data may besent at a later time. In some implementations receiving the request mayinclude intercepting a load event for the external library and matchingthe load event to a pattern. In such implementations the determining andloading occur when the load event matches the pattern.

One aspect of the disclosure may be embodied in a computing device thatincludes a processor configured to execute a web browser initiated by anoperating system of the computing device and a local storage device. Thebrowser may be configured to receive a request from a web application toload an external library stored on a remote server, determine whetherthe web browser has a bundled version of the external library, and loadthe bundled version when it is determined that the bundled versionexists.

Another aspect of the disclosure may be embodied in a non-transitorycomputer readable medium containing instructions executable as a webbrowser running on a processor. The instructions may cause the processorto receive a request from a web application to load an external librarystored on a remote server, determine whether the web browser has abundled version of the external library, and load the bundled versionwhen it is determined that the bundled version exists.

The details of one or more implementations are set forth in theaccompanying drawings and the description below. Other features will beapparent from the description and drawings, and from the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram of a system for browser control ofexternal libraries used by web applications.

FIG. 2 is a flowchart of a process for making web applications availablethrough a web store.

FIG. 3 is a flowchart of a process for a browser fetch of an externallibrary.

FIG. 4 is a flowchart of a process for handling data directed to aremote server as a result of running an external library.

FIG. 5 shows an example of a computer device and a mobile computerdevice that can be used to implement the techniques described here.

Like reference symbols in the various drawings indicate like elements.

DETAILED DESCRIPTION

Systems and methods described here allow for browser control of the useof external libraries in a web application. A web store may control theexternal libraries used by web applications that are offered through theweb store and the browser may perform the fetching of the libraryresources at the time the web application runs. For example, when a webapplication is submitted to a web store or digital marketplace, the webstore may inspect the web application to determine whether it requiresan external library. If an external library is required, the web storemay consult a whitelist or blacklist to determine whether the externallibrary is allowed. If allowed, the web application may be accepted bythe web store and made available to users. If not allowed, the web storemay reject the web application.

When a web application loads an external library at runtime, the browsermay intercept the load event if the event matches a pattern. Forexample, the browser may store the URLs of external libraries and, ifthe URL of the load event matches a stored URL, the browser mayintercept the load event. In other implementations the web applicationmay make a special load request directed to the browser. In eithersituation, the browser may fetch the external library for the webapplication rather than allowing the web application to fetch andexecute the library. In so doing, the browser may take advantage oflocally stored copies of the libraries to allow the web application torun even without a network connection and, during such unconnected runs,may batch data destined for a remote server associated with the externallibrary until a network connection is established. In someimplementations the web application running in conjunction with theexternal library may mark the data as either eligible for batching ornot eligible, and the browser may only batch data flagged as eligible.

In addition, because the web application no longer runs the library at aremote server, updates to the library must be pushed. Thus, in someimplementations the browser may receive updates for the libraries andapply the updates to its local copy. The local copy may be a cached copyor a bundled copy.

FIG. 1 is a schematic block diagram of an example implementation of asystem 100 that may provide browser control of external libraries usedby web applications. In various implementations, the system 100 mayinclude client computing devices 102A, 102B, 102C (such as desktopcomputers, notebook computers, netbook computers, tablet computers,smart-phones, televisions with at least one processor, etc.). A clientcomputing device 102A can include one or more processors (CPU) 104 andone or more memories 106. The client computing device 102A can executean operating system (O/S) 108 and various applications (110, 120) whichmay display a user interface window (e.g., web browser 112). The clientcomputing device 102A can include a cache 118 and one or more nativeapplications 120. Application 110 is an example of a native application,and the user interface window of application 110 is a web browser 112.Other examples of native applications 120 include word processingapplications, image editing applications, email applications, mediaplayers, calculators, etc.

In various implementations, the web browser 112 may include or beassociated with one or more web applications 128. In this context, a“web application” may be configured to perform a single task or multipletasks for a user. In such an implementation, the web application may beconfigured to be executed or interpreted by the web browser 112. This iscompared with the native applications (e.g., native application 120)that include machine executable code and are configured to be executeddirectly by a processor or via the operating system of the clientdevice, whereas, a web application may be incapable of execution ordisplay without the aid of the web browser. Thus, web applications canbe run inside a browser with a dedicated user interface, and typicallyprovide functionality and an experience that is more rich andinteractive than a standalone website but are less cumbersome andmonolithic than a native application 120. Examples of web applicationsinclude games, photo editors, and video players that are run inside theweb browser 112.

Web applications can be “hosted applications” or “packagedapplications.” Hosted applications may include at least a portion of aweb site that itself includes web pages, plus some metadata that may beespecially pertinent to the web application or to the user of the webapplication to allow the web application to perform some particularfunctionality for the user. Packaged applications can be thought of asweb applications whose code is bundled, so that the user can downloadall of the content of the web application for execution by the browser.A packaged web application may not need to have network access toperform its functionality for the user, and rather may be executedsuccessfully by the browser locally on the computing device withoutaccess to a network. Packaged web applications have the option of usingExtension APIs, allowing packaged applications to change the way thebrowser behaves or looks.

In some implementations, browser 112 may sandbox web applications 128,so that web applications 128 cannot access the resources of computingdevice 102A or directly communicate with external servers, such asexternal server 170. Instead, browser 112 may control access toresources and external servers for web application 128.

In one implementation, the client computing device 102A may be runningor causing the operating system 108 to execute application 110 or webbrowser 112. In various implementations, this web browser 112 mayinclude a plurality of panes or tabs 114A, 114B, 114C. The web browser112 can be a visual area, usually rectangular, containing some kind ofuser interface. In a graphical user interface (GUI) used in the clientcomputing device 102A, the web browser 112 can be a two-dimensionalobject arranged on a plane of the GUI known as the desktop. The webbrowser 112 can include other graphical objects that may be called the“chrome” of the web browser, e.g., a menu-bar, toolbars, controls,icons. The web browser may also include a working area in which adocument, image, folder contents, or other main object (e.g., webapplication 128) can be displayed. The working area may be capable ofholding only one main object (i.e., in a single document interface) ormore than one main object in a multiple document interface. In someapplications, specifically web browsers, multiple documents can bedisplayed in individual tabs 114A, 114B, 114C. These tabs 114A, 114B,114C are typically displayed one at a time, and are selectable via atab-bar which often resides above the contents of an individual window.That is, one selected tab 114A is “forward-facing” and displaysinformation or content to a user in the web browser 112, with thecontent of other tabs 114B, 114C is “hidden.” The tabs 114A, 114B, and114C may execute in separate processes, each with its own individualmemory.

The client computing devices 102A, 102B, 102C may receive content fromone or more server computing devices 130, 170, that may be connected tothe client computing devices 102A, 102B, 102C through a network 190. Viathe network 190, the computing devices 102A, 102B, 102C may communicatewith the web store 130 and remote server 170. Network 190 may be anycomputer network including an intranet or the Internet. The web browser112 may allow a user of computing device 102A to browse web applications140 offered by web store server 130. Web applications 140 may bedownloaded, via network 190, to client computing device 102A andinstalled as web applications 128.

As shown in FIG. 1, the system 100 can include a server 130 thatincludes one or more processors 132, one or more memories 134, anoperating system 136, and one or more web applications 140. Webapplications 140 may be available for download and installation viaserver 130, for example. Web store server 130 may be a web store thathosts the web applications 140 and makes them available to computingdevices 102A, 102B, 102C. In some implementations, the web store server130 may ensure that the web applications 140 access only allowedexternal libraries before making web applications 140 available fordownload. For example, server 130 may include one or more black lists150, one or more white lists 152, or both. Black lists 150 indicateexternal libraries that are not allowed. Therefore, if a web applicationpresented to web store server 130 accesses an external library that isidentified on the black list 150, the web store server 130 may preventthe web application from being stored as web applications 140 and frombeing made available for download. In some implementations, web storeserver 130 may include a white list 152. The white list 152 identifiesexternal libraries that are allowed. Therefore, if a web applicationpresented to web store server 130 accesses an external libraryidentified on the white list 152, the web store server 130 may allow theweb application to be stored as web applications 140. Thus, the webstore server 130 may control the types of external libraries used by theweb applications 140 available from the web store.

As shown in FIG. 1, the system 100 can also include a remote server 170that includes one or more processors 172, one or more memories 174, anoperating system 176, and one or more external libraries 178. Theexternal libraries 178 may be offered by vendors or other third partiesto enhance the functionality of web applications.

As previously mentioned, a user may download an application 140 from webstore server 130 and install the web application on computing device102A. The installed version of the web application may be webapplication 128. Web application 128 may require access to and use ofone or more external libraries 178. External libraries 178 may be hostedby a remote server 170 (or another server) and available for use by webapplications 128. However, browser 112 may prevent web application 128from executing external library 178 from server 170. Instead, browser112 may fetch the library from server 170 when needed by the webapplication.

For example, when a user runs a web application 128, the web application128 may request an external library. In some implementations the webbrowser 112 may intercept the request. In other implementations the webapplication may make a specific request to web browser 112 for theexternal library. In either situation, the web browser 112 may make thenetwork request on behalf of the web application 128. This fetching pathis distinct from the standard resource fetching path for packagedapplications, where requests for external libraries are denied. Apackaged application is an application that has any external librariesbundled with the application and installed at the time that applicationis installed. As part of the fetch operation the browser 112 may takeadvantage of locally stored copies of the library. For example,computing device 102A may store cached versions 124 of externallibraries and/or bundled versions 126 of external libraries. The cachedversions 124 and bundled versions 126 may be locally stored copies ofexternal libraries 178. In some implementations, the browser 112 maydetermine whether a cached version 124 or a bundled version 126 of anexternal library exists on computing device 102A before fetching theexternal library 178 from server 170. Cached libraries 124 may bedownloaded from remote server 170 via a web browser 112 and stored onclient computing device 102A as the result of a previous fetch requestfor the library. Bundled libraries 126 may be installed on clientcomputing device 102A when browser 112 is installed or when updates tobrowser 112 are installed. Thus, cached libraries 124 and bundledlibraries 126 may be stored at computing device 102A before a webapplication 128 is downloaded and installed and are stored independentlyof web application 128. If a locally stored version of the library doesnot exist, browser 112 may fetch the external library 178 from server170. In some implementations, the browser 112 may store the fetchedlibrary in cached libraries 124. Using a locally stored version of anexternal library allows the web application 128 to be run offline, evenwhen the browser 112 cannot connect to server 170 via network 190.

In some implementations, the external library executed by webapplication 128 may communicate data to server 170 in order to providesome functionality. In such implementations, if browser 112 provided alocally stored version of the external library for web application 128and computing device 102A is not connected to server 170 via network190, browser 112 may store, or batch, the data until a connectionbecomes available. Thus, computing device 102A may include batched data122, which is stored temporarily at computing device 102A until aconnection with server 170 is established.

FIG. 2 is a flowchart of a process 200 for making web applicationsavailable through a web store. As discussed above, a web store ordigital marketplace may offer web applications for particular browsers.Some web stores may endeavor to control the applications offered by thestore and, accordingly may require inspection and approval of new webapplications before the web applications are added to the web store andmade available for download. Accordingly, a web store server, such asserver 130 of FIG. 1, may receive a request to add a web application tothe web store (210). The web application may be a hosted application ora packaged application. After receiving the request, the web storeserver may inspect the web application for use of external libraries,such as a JavaScript library (220). The web store server may detect suchuse in a variety of ways. For example, the web application may includean explicit declaration in the application manifest file. Theapplication manifest file contains information about the webapplication, such as its name, version, what permissions it needs, whatfunctions or operations it performs, etc. The manifest file may alsocontain an explicit statement indicating that the web applicationaccesses a particular external library. When the web store serverencounters such an explicit statement, the web store server maydetermine that the web application uses the external library.

In some implementations, the web store server may analyze the executablecode of the web application for references to an external library. Forexample, the web store server may look for a statement, such as a“script” element, the creation of a “script” document object model (DOM)node, or a # include or an import statement, that identifies an externallibrary. If no external libraries are used (220, No) then the web storeserver may proceed to add the web application to the web store (250),making it available for download to a client computing system. Ofcourse, in some implementations the web store server may have othercriteria to evaluate before making the web application available throughthe web store, but such other criteria are not shown in FIG. 2.

If the web store server finds use of an external library by the webapplication (220, Yes), the web store server may determine whether theexternal library is trusted (230). For example, the web store server mayconsult a whitelist to determine whether the external library is knownto be trusted. If the external library appears on the whitelist then theweb store server may determine that the external library is trusted. Insome implementations the web store server may consult a blacklist todetermine whether the external library is known to be untrustworthy. Ifthe external library does not appear on the blacklist, the web storeserver may determine the external library is trusted. But if theexternal library appears on the blacklist, the web store server maydetermine the external library not trusted. If trusted (230, Yes), theweb store may accept the web application and make it available to users(250). If not trusted (230, No), the web store server may block the webapplication from being added to the web store and may notify therequestor that the application was blocked (240). Thus, the web storeserver may control the external resources accessed by web applicationsavailable through the web store using process 200, providing a level ofsecurity to the customers of the web store. If the web application is ahosted application, the web store server may periodically performprocess 200 after the web application has been added to the web store todetect changes in the use of external libraries. If an external librarythat is not trusted is found in step 230 the web store server may removethe web application from the web store so that it is no longeraccessible by customers of the web store.

FIG. 3 is a flowchart of an example process 300 for a browser fetch ofan external library. Process 300 may be performed by a browser, such asbrowser 112 of FIG. 1, at the time that a web application that uses anexternal library runs. Process 300 may be used when the browser does notallow web applications to execute external libraries from a remoteserver, but the web application still utilizes the libraries.

In process 300 the browser may receive a request from a web applicationto load an external library stored on a remote server (310). In someimplementations, the browser may intercept a load event issued by theweb application. In such implementations the browser may determinewhether the load event matches a pattern. For example, the browser maylook for a uniform resource locator (URL) that matches a known externallibrary, or a server hosting the external library. In someimplementations the web application may include a special load requestdirected to the browser that specifically requests that the browser loada particular external library.

Once the browser receives the request, the browser may determine whetherit has a locally cached version of the external library (320). A locallycached version may be a copy of the external library downloaded from theremote server hosting the library and stored on the computing devicerunning the browser. For example, the locally cached version may bestored in cached libraries 124 shown in FIG. 1. The browser may createthe local cache of libraries as it fetches the libraries for executingweb applications. As with other cache storage, the cached libraries maybe deleted after some period of time or deleted explicitly by a usercommand. If the browser locates the external library in the local cache(320, Yes), the browser may use the cached version. This allows thebrowser to provide the library to the web application faster thanfetching it from the remote server and makes the library availableregardless of whether the local computing device can connect andcommunicate with the remote server.

If no cached version exists (320, No), then the browser may determinewhether a version of the library has been bundled with the browser(340). A bundled version may be a version provided with the files usedto install the browser. For example, some commonly used JavaScriptlibraries may be included with the files installed when the browser isinstalled or included with a browser update. Such bundled externallibraries may be locally stored, for example, in bundled libraries 126shown in FIG. 1. Bundled libraries may be stored locally but, unlikecached libraries, bundled libraries may not be deleted after a certainamount of time. If the browser locates the external library in thebundled libraries (340, Yes), then the browser may use the bundledversion (350). As with a cached version, a bundled version allows theweb application to use the library without a connection to the remoteserver.

If neither a cached version nor a bundled version exists, the browsermay fetch the external library from the remote server (360). Asexplained above, the fetch is performed under control of the browser,not the web application. In some implementations the browser may storethe fetched version in cache for later use, for example the next timethe web application is executed. Once the browser has provided theexternal library to the web application, process 300 ends. In someimplementations, before fetching the library from the remote server theweb browser may consult the black list or white list of externallibraries to determine whether the library is still trusted. The webbrowser may do this via a web store server, such as web store server 130shown in FIG. 1. If the library is no longer trusted, the browser mayprevent the web application from using the external library.

When external libraries are bundled with the web application, updates tothe library must be pushed to each installed web application. Oneadvantage of having the browser fetch and load the external library isthat updates to the library can be pushed to the browser and need not bepushed to each web application that bundles the library. For example, anupdate to a library may be pushed to the browser when the browserautomatically looks for and applies software updates. In such anexample, the third party supplying the library may work with the browservendors to push the updates to local computing devices. Because thenumber of browsers is limited, this is not burdensome. Furthermore, somebrowsers perform such updates automatically, so the user of thecomputing device need not be aware of the update. Such an update modeloffers a faster and more complete update flow than attempting to pushupdates to each web application that uses the library.

FIG. 4 is a flowchart of a process 400 for handling data directed to aremote server as a result of running an external library. Externallibraries sometimes send data to a remote server to facilitate certainlibrary-related functions. For example, a web analytics library may senddata indicating a drop-off rate for transactions, data indicating that auser loaded a site as a result of clicking on a particular ad, etc. Whena locally stored version of the external library allows the webapplication to run without a network connection, this data may be lost.However, some implementations may enable the browser to observe andcontrol data communications between the library and the remote server.Thus, process 400 may be performed at least in part by a browser runningon a client computing device (e.g., browser 112 running on computingdevice 102A shown in FIG. 1).

In process 400 the browser may intercept a request from the running webapplication to send data to the remote server (410). The remote servermay be the server that hosts the external library, such as server 170shown in FIG. 1. The browser may intercept the requests to ensure thatthe browser has control of communications between the computing deviceand remote servers. The browser may then determine whether the computingdevice has connectivity with the remote server (420). For example, thebrowser may determine whether an Internet connection exists between thecomputing device and the remote server. If connectivity exists (420,Yes), then the browser may send the data to the remote server (430) andthe browser may complete process 400.

But when connectivity does not exist (420, No), the browser maydetermine whether the data is flagged as okay to send at a later time(440). For example, some data is time sensitive and cannot wait until alater time or would be useless if sent at a later time. Such data mayinclude data that necessitates a response, such as a financialtransaction that requires acknowledgement, data that may cause aconflict if applied later, such as changes to a document stored on aremote server, etc. On the other hand, some data may be gathered forstatistical analysis and can be uploaded to the remote server at anytime. The web application or external library may flag data that can bebatched for later transmission to the remote server. The browser maylook for this flag to determine whether the data can be sent at a latertime. If the data cannot wait (440, No), the browser may communicate anerror message to the web application (450) so that the web applicationknows that the data transfer could not be completed. If the data isflagged as permissible to send at a later time (440, Yes) then thebrowser may store the data locally until establishing a connection withthe remote server (460). In some implementations the data may be batchedwith other data destined for the remote server.

The process shown in FIGS. 2-4 are examples of one implementation, andmay have steps deleted, reordered, or modified. For example, 320 and 340may be combined, reordered, or the browser may not perform one of thesteps. As another example, the process 300 may also include determiningwhether a load event matches a pattern (e.g., a URL of the externallibrary), and process 200 may include gathering and analyzinginformation in addition to whitelist and/or blacklist data to determinewhether an external library is trusted.

FIG. 5 shows an example of a generic computer device 500 and a genericmobile computer device 550, which may be used with the techniquesdescribed here. Computing device 500 is intended to represent variousforms of digital computers, such as laptops, desktops, workstations,personal digital assistants, televisions with at least one processor,servers, blade servers, mainframes, and other appropriate computers.Computing device 550 is intended to represent various forms of mobiledevices, such as personal digital assistants, cellular telephones, smartphones, and other similar computing devices. The components shown here,their connections and relationships, and their functions, are meant tobe exemplary only, and are not meant to limit implementations of theinventions described and/or claimed in this document.

Computing device 500 includes a processor 502, memory 504, a storagedevice 506, a high-speed interface 508 connecting to memory 504 andhigh-speed expansion ports 510, and a low speed interface 512 connectingto low speed bus 514 and storage device 506. Each of the components 502,504, 506, 508, 510, and 512, are interconnected using various busses,and may be mounted on a common motherboard or in other manners asappropriate. The processor 502 can process instructions for executionwithin the computing device 500, including instructions stored in thememory 504 or on the storage device 506 to display graphical informationfor a GUI on an external input/output device, such as display 516coupled to high speed interface 508. In other implementations, multipleprocessors and/or multiple buses may be used, as appropriate, along withmultiple memories and types of memory. Also, multiple computing devices500 may be connected, with each device providing portions of thenecessary operations (e.g., as a server bank, a group of blade servers,or a multi-processor system).

The memory 504 stores information within the computing device 500. Inone implementation, the memory 504 is a volatile memory unit or units.In another implementation, the memory 504 is a non-volatile memory unitor units. The memory 504 may also be another form of computer-readablemedium, such as a magnetic or optical disk.

The storage device 506 is capable of providing mass storage for thecomputing device 500. In one implementation, the storage device 506 maybe or contain a computer-readable medium, such as a floppy disk device,a hard disk device, an optical disk device, or a tape device, a flashmemory or other similar solid state memory device, or an array ofdevices, including devices in a storage area network or otherconfigurations. A computer program product can be tangibly embodied inan information carrier. The computer program product may also containinstructions that, when executed, perform one or more methods, such asthose described above. The information carrier is a computer- ormachine-readable medium, such as the memory 504, the storage device 506,or memory on processor 502.

The high speed controller 508 manages bandwidth-intensive operations forthe computing device 500, while the low speed controller 512 manageslower bandwidth-intensive operations. Such allocation of functions isexemplary only. In one implementation, the high-speed controller 508 iscoupled to memory 504, display 516 (e.g., through a graphics processoror accelerator), and to high-speed expansion ports 510, which may acceptvarious expansion cards (not shown). In the implementation, low-speedcontroller 512 is coupled to storage device 506 and low-speed expansionport 514. The low-speed expansion port, which may include variouscommunication ports (e.g., USB, BLUETOOTH, Ethernet, wireless Ethernet)may be coupled to one or more input/output devices, such as a keyboard,a pointing device, a scanner, or a networking device such as a switch orrouter, e.g., through a network adapter.

The computing device 500 may be implemented in a number of differentforms, as shown in the figure. For example, it may be implemented as astandard server 520, or multiple times in a group of such servers. Itmay also be implemented as part of a rack server system 524. Inaddition, it may be implemented in a personal computer such as a laptopcomputer 522. Alternatively, components from computing device 500 may becombined with other components in a mobile device (not shown), such asdevice 550. Each of such devices may contain one or more of computingdevice 500, 550, and an entire system may be made up of multiplecomputing devices 500, 550 communicating with each other.

Computing device 550 includes a processor 552, memory 564, aninput/output device such as a display 554, a communication interface566, and a transceiver 568, among other components. The device 550 mayalso be provided with a storage device, such as a microdrive or otherdevice, to provide additional storage. Each of the components 550, 552,564, 554, 566, and 568, are interconnected using various buses, andseveral of the components may be mounted on a common motherboard or inother manners as appropriate.

The processor 552 can execute instructions within the computing device550, including instructions stored in the memory 564. The processor maybe implemented as a chipset of chips that include separate and multipleanalog and digital processors. The processor may provide, for example,for coordination of the other components of the device 550, such ascontrol of user interfaces, applications run by device 550, and wirelesscommunication by device 550.

Processor 552 may communicate with a user through control interface 558and display interface 556 coupled to a display 554. The display 554 maybe, for example, a TFT LCD (Thin-Film-Transistor Liquid Crystal Display)or an OLED (Organic Light Emitting Diode) display, or other appropriatedisplay technology. The display interface 556 may comprise appropriatecircuitry for driving the display 554 to present graphical and otherinformation to a user. The control interface 558 may receive commandsfrom a user and convert them for submission to the processor 552. Inaddition, an external interface 562 may be provide in communication withprocessor 552, so as to enable near area communication of device 550with other devices. External interface 562 may provide, for example, forwired communication in some implementations, or for wirelesscommunication in other implementations, and multiple interfaces may alsobe used.

The memory 564 stores information within the computing device 550. Thememory 564 can be implemented as one or more of a computer-readablemedium or media, a volatile memory unit or units, or a non-volatilememory unit or units. Expansion memory 574 may also be provided andconnected to device 550 through expansion interface 572, which mayinclude, for example, a SIMM (Single In Line Memory Module) cardinterface. Such expansion memory 574 may provide extra storage space fordevice 550, or may also store applications or other information fordevice 550. Specifically, expansion memory 574 may include instructionsto carry out or supplement the processes described above, and mayinclude secure information also. Thus, for example, expansion memory 574may be provide as a security module for device 550, and may beprogrammed with instructions that permit secure use of device 550. Inaddition, secure applications may be provided via the SIMM cards, alongwith additional information, such as placing identifying information onthe SIMM card in a non-hackable manner.

The memory may include, for example, flash memory and/or NVRAM memory,as discussed below. In one implementation, a computer program product istangibly embodied in an information carrier. The computer programproduct contains instructions that, when executed, perform one or moremethods, such as those described above. The information carrier is acomputer- or machine-readable medium, such as the memory 564, expansionmemory 574, or memory on processor 552 that may be received, forexample, over transceiver 568 or external interface 562.

Device 550 may communicate wirelessly through communication interface566, which may include digital signal processing circuitry wherenecessary. Communication interface 566 may provide for communicationsunder various modes or protocols, such as GSM voice calls, SMS, EMS, orMMS messaging, CDMA, TDMA, PDC, WCDMA, CDMA2000, or GPRS, among others.Such communication may occur, for example, through radio-frequencytransceiver 568. In addition, short-range communication may occur, suchas using a Bluetooth, WiFi, or other such transceiver (not shown). Inaddition, GPS (Global Positioning System) receiver module 570 mayprovide additional navigation- and location-related wireless data todevice 550, which may be used as appropriate by applications running ondevice 550.

Device 550 may also communicate audibly using audio codec 560, which mayreceive spoken information from a user and convert it to usable digitalinformation. Audio codec 560 may likewise generate audible sound for auser, such as through a speaker, e.g., in a handset of device 550. Suchsound may include sound from voice telephone calls, may include recordedsound (e.g., voice messages, music files, etc.) and may also includesound generated by applications operating on device 550.

The computing device 550 may be implemented in a number of differentforms, as shown in the figure. For example, it may be implemented as acellular telephone 550. It may also be implemented as part of a smartphone 552, personal digital assistant, or other similar mobile device.

Various implementations of the systems and techniques described here canbe realized in digital electronic circuitry, integrated circuitry,specially designed ASICs (application specific integrated circuits),computer hardware, firmware, software, and/or combinations thereof.These various implementations can include implementation in one or morecomputer programs that are executable and/or interpretable on aprogrammable system including at least one programmable processor, whichmay be special or general purpose, coupled to receive data andinstructions from, and to transmit data and instructions to, a storagesystem, at least one input device, and at least one output device.

These computer programs (also known as programs, software, softwareapplications or code) include machine instructions for a programmableprocessor, and can be implemented in a high-level procedural and/orobject-oriented programming language, and/or in assembly/machinelanguage. As used herein, the terms “machine-readable medium” or“computer-readable medium” refer to any computer program product,apparatus and/or device (e.g., magnetic discs, optical disks, memory,Programmable Logic Devices (PLDs)) used to provide machine instructionsand/or data to a programmable processor.

To provide for interaction with a user, the systems and techniquesdescribed here can be implemented on a computer having a display device(e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor)for displaying information to the user and a keyboard and a pointingdevice (e.g., a mouse or a trackball) by which the user can provideinput to the computer. Other kinds of devices can be used to provide forinteraction with a user as well; for example, feedback provided to theuser can be any form of sensory feedback (e.g., visual feedback,auditory feedback, or tactile feedback); and input from the user can bereceived in any form, including acoustic, speech, or tactile input.

The systems and techniques described here can be implemented in acomputing system that includes a back end component (e.g., as a dataserver), or that includes a middleware component (e.g., an applicationserver), or that includes a front end component (e.g., a client computerhaving a graphical user interface or a Web browser through which a usercan interact with an implementation of the systems and techniquesdescribed here), or any combination of such back end, middleware, orfront end components. The components of the system can be interconnectedby any form or medium of digital data communication (e.g., acommunication network). Examples of communication networks include alocal area network (“LAN”), a wide area network (“WAN”), and theInternet.

The computing system can include clients and servers. A client andserver are generally remote from each other and typically interactthrough a communication network. The relationship of client and serverarises by virtue of computer programs running on the respectivecomputers and having a client-server relationship to each other.

A number of implementations have been described. Nevertheless, it willbe understood that various modifications may be made without departingfrom the spirit and scope of the invention.

In addition, the logic flows depicted in the figures do not require theparticular order shown, or sequential order, to achieve desirableresults. In addition, other steps may be provided, or steps may beeliminated, from the described flows, and other components may be addedto, or removed from, the described systems. Accordingly, otherembodiments are within the scope of the following claims.

What is claimed is:
 1. A method comprising: inspecting, using at leastone processor, a web application for requests to use external libraries;and determining, using the at least one processor, whether an identifiedexternal library is trusted; preventing the web application from beingadded to a web store when the identified external library is nottrusted; and allowing the web application to be added to the web storewhen the identified external library is trusted.
 2. The method of claim1, wherein determining whether the identified external library istrusted includes determining whether the identified external library ison a whitelist or a blacklist.
 3. The method of claim 1, whereininspecting the web application for requests includes: inspecting amanifest file associated with the web application; and determiningwhether the manifest file includes an explicit declaration identifyingthe external library.
 4. A non-transitory computer readable mediumcontaining instructions executable by the processor, the instructionscausing the processor to perform the method of claim
 1. 5. Acomputer-implemented method executed by at least one processorperforming operations for a web browser, the method, performed by theweb browser, comprising: receiving a request from a web application toload an external library stored on a remote server; determining whetherthe web browser has a bundled version of the external library; andloading the bundled version when it is determined that the bundledversion exists.
 6. The method of claim 5, wherein the determining andloading occurs only when a locally cached version of the library doesnot exist.
 7. The method of claim 6, further comprising: fetching theexternal library from the remote server when it is determined that theweb browser does not have a bundled version of the external library; andcaching the external library in a memory associated with the webbrowser.
 8. The method of claim 5, wherein the external library isbundled with an update to the web browser.
 9. The method of claim 5,further comprising: receiving an update to the external library at theweb browser from the remote server; and updating the bundled versionwhen a bundled version exists.
 10. The method of claim 5, wherein theexternal library is bundled with the web application.
 11. The method ofclaim 5, wherein the external library is configured to send data to theremote server and the method further includes: intercepting a request tosend the data to the remote server; determining whether a connectionwith the server exists; when a connection does not exist, determiningwhether the data may be sent at a later time; and when the data may besent at a later time, storing the data until a connection with theremote server is established.
 12. The method of claim 5, whereinreceiving the request includes: intercepting a load event for theexternal library; and matching the load event to a pattern, wherein thedetermining and loading occur when the load event matches the pattern.13. The method of claim 5, wherein the web application is executed bythe web browser.
 14. The method of claim 5, wherein the external libraryis a web analytics library.
 15. A computing device comprising: aprocessor configured to execute a web browser initiated by an operatingsystem of the computing device; and a local storage device; the browserconfigured to: receive a request from a web application to load anexternal library stored on a remote server; determine whether the webbrowser has a bundled version of the external library; and load thebundled version when it is determined that the bundled version exists.16. The computing device of claim 15, the browser further configured to:fetch the external library from the remote server when it is determinedthat the web browser does not have a bundled version of the externallibrary or a locally cached version of the external library; and cachethe external library in the local storage device.
 17. The computingdevice of claim 16, wherein the external library is bundled with the webapplication.
 18. The computing device of claim 15, wherein the externallibrary is configured to send data to the remote server and the browseris further configured to: intercept a request to send the data to theremote server; determine whether a connection with the server exists;when a connection does not exist, determine whether the data may be sentat a later time; and when the data may be sent at a later time, storethe data in the local storage device until a connection with the remoteserver is established.
 19. The computing device of claim 15, wherein aspart of receiving the request, the browser is configured to: intercept aload event for the external library; and match the load event to apattern, wherein the determining and loading occur when the load eventmatches the pattern.
 20. The computing device of claim 19, wherein aspart of determining whether the data may be sent at a later time theinstructions further cause the processor to inspect a flag set by theweb application.
 21. A non-transitory computer readable mediumcontaining instructions executable as a web browser running on aprocessor, the instructions causing the processor to: receive a requestfrom a web application to load an external library stored on a remoteserver; determine whether the web browser has a bundled version of theexternal library; and load the bundled version when it is determinedthat the bundled version exists.
 22. The non-transitory computerreadable medium of claim 21, the instructions further causing theprocessor to: fetch the external library from the remote server when itis determined that the web browser does not have a bundled version ofthe external library; and cache the external library in a local memory.23. The non-transitory computer readable medium of claim 21, wherein theexternal library is configured to send data to the remote server and theinstructions further cause the processor to: intercept a request to sendthe data to the remote server; determine whether a connection with theserver exists; when a connection does not exist, determine whether thedata may be sent at a later time; and when the data may be sent at alater time, store the data in a local memory until a connection with theremote server is established.
 24. The non-transitory computer readablemedium of claim 23, wherein as part of determining whether the data maybe sent at a later time the instructions further cause the processor toinspect a flag set by the web application.
 25. The non-transitorycomputer readable medium of claim 21, wherein as part of receiving therequest, the instructions further cause the processor to: intercept aload event for the external library; and match the load event to apattern, wherein the determining and loading occur when the load eventmatches the pattern.
 26. The non-transitory computer readable medium ofclaim 21, wherein as part of receiving the request, the instructionsfurther cause the processor to: intercept a load event for the externallibrary; and match the load event to a pattern, wherein the determiningand loading occur when the load event matches the pattern.